Repository navigation
feat(telemetry): add the Claude Code telemetry adapter (2/4, GRO-305) - #27
teallarson wants to merge 2 commits into
Conversation
|
@BugBot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1c51f07. Configure here.
teallarson
left a comment
There was a problem hiding this comment.
Independent final review at 1c51f07f115d5b3965b133368e542b37b13719ae: ready for human review with telemetry OFF.
Independent mapping/opt-out review: 21 focused tests, typecheck, generation and all 19 literal enabled-fixture shell commands silent while OFF. No remaining code finding.
Ready-for-review CI passed tests, all four client checks and the required aggregate gate; current-head Cursor Bugbot is green. Final combined heads plus main 18c7c99 passed 170/170 tests, zero skips, typecheck, four validators and 13 generated outputs. Independent combined privacy/release/adapter-removal review found no new blocker.
Windows, live client delivery and production ingestion remain activation prerequisites. No merge, release or collection enablement is authorized by this review. Descriptions preserve own-base review maps and limitations; Teal will inspect and request human reviewers.
— Strider 🐦⬛, Teal's agent · approved by Teal
…n gate The 19 enabled-fixture commands were fed a SessionStart input, which maps to no event, so the test passed even with TELEMETRY_ENABLED flipped true. Feed a sendable prompt, clear inherited Claude opt-outs, and add a positive control that the loopback capture server observes a direct send. Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
1c51f07 to
45edb2c
Compare
Part of GRO-305 · issue
What/why
Prepares Claude Code to measure when a prompt may benefit from Arcade and whether Arcade is used, including tool failures and operator completion status. These measurements would add client-side context that server call logs cannot provide. Collection stays disabled: this PR leaves shipped hooks unchanged and sends no telemetry.
Codebase changes
Adds a Claude Code adapter to the existing telemetry hook generator. It maps prompt, tool, and subagent callbacks into the shared event format, identifies Arcade versus other tools, and honors Claude-specific opt-outs. Fixtures and tests cover event mapping, turn scope, opt-outs, generated hook wiring, and the disabled runtime.
Additional notes
Current-head CI passes tests and all four client validators. Disabled-runtime tests verify that hooks emit no output or telemetry, with a positive control to confirm the test can detect a send. Live Claude delivery, Windows behavior, and production ingestion remain unverified. Enabling collection requires a separate reviewed change and privacy approval.
— Strider 🐦⬛, Teal's agent · approved by Teal.
Note
Medium Risk
Introduces client-specific telemetry classification and future hook wiring for prompts and tool use; behavior is gated off in shipped manifests but touches privacy-sensitive observation paths when enabled.
Overview
Adds a Claude Code–specific telemetry adapter and registers it on the
claude-codehost viatelemetry: "claude-code"inhook-hosts.mjs, so the shared hook generator andtelemetryHookRows()can emit the intended wiring when collection is turned on.The new
hooks/telemetry-adapters/claude-code.mjsmaps Claude hook payloads to contract events: Arcade vsclaude_aiMCP tool prefixes, auth status fromSystem_ManageAuthorization, operator subagent stop parsing, scoped vs always-on observation (requiresTurn), Claude opt-outs (DISABLE_TELEMETRY,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICas any non-empty value), and hook rows for prompts, PreToolUse (Arcade matchers), PostToolUse/Failure (MCP, WebFetch/WebSearch, per-CLI Bash withif+--cli).Tests and fixtures cover end-to-end event mapping, turn scope/TTL, opt-outs, manifest parity with
hooks.enabled.json, and that the checked-in.claude-plugin/hooks.jsonstill has notelemetry.mjswhile the global OFF gate remains false.Reviewed by Cursor Bugbot for commit 45edb2c. Bugbot is set up for automated code reviews on this repo. Configure here.